package com.woniuxy.dudugua.service;

import com.woniuxy.dudugua.entity.Address;
import com.woniuxy.dudugua.entity.Order;
import com.woniuxy.dudugua.entity.OrderInfo;
import com.woniuxy.dudugua.util.view.CouponsView;
import com.woniuxy.dudugua.util.view.ProductAndCategoryView;
import com.woniuxy.dudugua.util.view.UserCouponsView;

import java.util.List;

public interface OrderService {

    //查询用户所有优惠券
    List<UserCouponsView> selectUserConponsViewCanUse(int userid,Integer[] skuid);
    //判断该商品是否能够使用优惠券
    boolean canUse(UserCouponsView userCouponsView, ProductAndCategoryView productAndCategoryView);

    //根据skuid获取商品和类型的视图
    ProductAndCategoryView selectProductAndCategoryViewBySkuId(int skuid);
    //创建订单 和orderinfo
    int insertOrder(List<OrderInfo> list, Address address, UserCouponsView userCouponsView,int userid);
    //根据id查询订单
    Order selectOrderById(int id);
    //更新订单的状态
    int updateStatus(int orderid,int status);
    //查询用户所有优惠券
    List<UserCouponsView> selectAllConpons(Integer userId)throws Exception;
}
